package com.xian;

/**
 * @Author: yanjunfeng
 * @Description: TODO
 * @Date: Created in 上午9:29 2022/7/14
 * @Modified By:
 */

/**
 * 无固定工资的销售人员
 */
public class SalesEmployee extends  Employee{

    private int salesVolume;//销售额

    public static final double BASE_ROYALTY=0.05;//三万以下提成率

    public static final double MAX_ROYALTY=0.08;//三万以上的提成率

    public int getSalesVolume() {
        return salesVolume;
    }

    public void setSalesVolume(int salesVolume) {
        this.salesVolume = salesVolume;
    }

    public SalesEmployee(String name,int month,int salesVolume){
        super(name,month);
        this.salesVolume=salesVolume;
    }

    @Override
    public double getSalary() {
        if(this.salesVolume>30000){
           return 30000*SalesEmployee.BASE_ROYALTY+(this.salesVolume-30000)*SalesEmployee.MAX_ROYALTY+this.getSalarybyBri();
        }else{
           return this.salesVolume*SalesEmployee.BASE_ROYALTY+this.getSalarybyBri();
        }
    }
}
